package ink.yql.dao;

import ink.yql.model.Dynamic;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author YQL
 */
@Mapper
public interface DynamicDao {

    @Select("select * from dynamic where uid = #{uid}")
    List<Dynamic> getByUid(@Param("uid") Integer uid);

    @Select("select * from dynamic where did = #{did}")
    Dynamic getByDid(@Param("did") Integer did);

    @Insert("insert into dynamic (uid,,daddtime,dcomments,dcontext,dlike,dstatus)values" +
              "(#{uid} ,#{daddtime} ,#{dcomments} ,#{dcontext},#{dlike} ,#{dstatus}  )")
    Integer addOne(Dynamic dynamic);

    @Delete("delete from dynamic where did = #{did}")
    Integer deleteDid(@Param("did") Integer did);

}
